//    Copyright (C) Kherty.  All rights reserved.
namespace OpenLS.Spreadsheet.Extensibility
{
    public class TreatStringsAsZeroAttribute : ParameterConverterAttribute
    {
        public TreatStringsAsZeroAttribute()
        {

        }
        public TreatStringsAsZeroAttribute(ReferenceOption refMode)
            : base(refMode)
        { }
        internal override void ConvertImp(ConversionData data)
        {
            if (data.TargetType == typeof(double))
            {
                if (data.Value is string)
                    data.Result = 0.0d;
            }
        }
    }
}